package com.education.welco.mapper;


import com.education.welco.pojo.SCatalogWork;
import com.education.welco.pojo.TClass;
import com.education.welco.pojo.vo.SCatalogWorkApp;
import com.education.welco.pojo.vo.StudentWorkVo;
import com.education.welco.pojo.vo.WholeWorkInfoApp;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * 课程作业 数据层
 *
 * @author d
 * @date 2020-05-08
 */
@Repository
public interface SCatalogWorkMapper {

    /**
     * 查询课程作业信息
     *
     * @param id 课程作业ID
     * @return 课程作业信息
     */
    public SCatalogWork selectSCatalogWorkById(Integer id);

    /**
     * 查询课程作业信息
     *
     * @param catalogId 课程作业ID
     * @return 课程作业信息
     */
    public List<SCatalogWork> selectSCatalogWorkByCatalogId(@Param("catalogId") Integer catalogId);

    /**
     * 查询课程作业信息
     *
     * @param list 课程作业ID
     * @return 课程作业信息
     */
    public List<SCatalogWork> selectSCatalogWorkByIds(@Param("list") List<Integer> list);

    /**
     * 查询课程作业列表
     *
     * @param sCatalogWork 课程作业信息
     * @return 课程作业集合
     */
    public List<SCatalogWork> selectSCatalogWorkList(SCatalogWork sCatalogWork);

    /**
     * 新增课程作业
     *
     * @param sCatalogWork 课程作业信息
     * @return 结果
     */
    public int insertSCatalogWork(SCatalogWork sCatalogWork);

    /**
     * 修改课程作业
     *
     * @param sCatalogWork 课程作业信息
     * @return 结果
     */
    public int updateSCatalogWork(SCatalogWork sCatalogWork);

    /**
     * 删除课程作业
     *
     * @param id 课程作业ID
     * @return 结果
     */
    public int deleteSCatalogWorkById(Integer id);

    /**
     * 批量删除课程作业
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteSCatalogWorkByIds(String[] ids);

    List<SCatalogWork> selectCatalogWorkStuList(SCatalogWork sCatalogWork);

    List<SCatalogWork> selectSCatalogWorkAllList(SCatalogWork catalogWork);

    List<SCatalogWork> selectSAnsweringStuList(SCatalogWork sCatalogWork);

    List<Integer> selectSCatalogWorkStuListAll(SCatalogWork sCatalogWork);

    List<Integer> selectSCatalogWorkStuListSome(@Param("courseId") String courseId,@Param("stuId") Integer stuId);

    List<SCatalogWork> selectSCatalogWorkStuListOther(@Param("list") List<Integer> other);

    List<SCatalogWork> workListByTeacher(@Param("teaId")Integer teaId,@Param("workName") String workName,@Param("workState") Integer workState,@Param("classId") Integer classId);

    List<TClass> selectClassByworkId(@Param("workId") Integer workId);

    List<TClass> classIdAndNameForWork(@Param("teaId") Integer teaId);

    List<StudentWorkVo> classWorkList(@Param("teaWorkId") Integer teaWorkId,@Param("workState") Integer workState);

    StudentWorkVo workByworkIdandUserId(@Param("id") Integer id);

    int workMarkById(@Param("id") Integer id, @Param("score") BigDecimal score, @Param("remark") String remark, @Param("state") Integer state);

    List<TClass> selectClassByTopCatalogId(@Param("topCatalogId") Integer topCatalogId);

    List<TClass> selectClassByTeaId(@Param("teaId") Integer teaId);

    List<Integer> workListByWorkIdandClassId(@Param("teaWorkId") String teaWorkId);

    int selectWaitStudentWorkNumByTeaId(@Param("teaId") String teaId);

    List<SCatalogWorkApp> selectWorkListForTea(@Param("teaId") Integer teaId);

    List<WholeWorkInfoApp> wholeWorkInfo(@Param("workId") Integer workId, @Param("likeName") String likeName);
}